import { combineReducers } from 'redux';
import { makeAsyncAction, ajax } from 'utils';
import items, { receiveItems } from './items';

export const fetchLists = makeAsyncAction(
  page => async (dispatch) => {
    const { success, rows } = await ajax.get('http://zbinfo.glsc.com.cn/wall/news/readLive?page=0', page);

    if (success) {
      dispatch(receiveItems(rows));
    }
  },
);

export default combineReducers({
  items,
});
